﻿using System;
using System.Drawing;
using System.Windows.Forms;

namespace Hourglass.Qrobot.Displayers
{
    public class PictureBoxDisplayer : IDisplayer
    {
        private readonly PictureBox _pictureBox;

        public PictureBoxDisplayer(PictureBox pictureBox)
        {
            this._pictureBox = pictureBox;
        }

        public void DisplayQRCode(Image image) => Invoke(() => this._pictureBox.Image = image);

        public void DisplayStatus(string status)
        {
            
        }

        private void Invoke(Action action)
        {
            this._pictureBox.Invoke(action);
        }
    }
}
